home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / syntax / jsp.vim < prev    next >
Encoding:
Text File  |  2001-08-14  |  2.8 KB  |  81 lines

  1. " Vim syntax file
  2. " Language:    JSP (Java Server Pages)
  3. " Maintainer:    Rafael Garcia-Suarez <rgarciasuarez@free.fr>
  4. " URL:        http://rgarciasuarez.free.fr/vim/syntax/jsp.vim
  5. " Last change:    2001 Aug 13
  6. " Credits : Patch by Darren Greaves (recognizes <jsp:...> tags)
  7.  
  8. " For version 5.x: Clear all syntax items
  9. " For version 6.x: Quit when a syntax file was already loaded
  10. if version < 600
  11.   syntax clear
  12. elseif exists("b:current_syntax")
  13.   finish
  14. endif
  15.  
  16. if !exists("main_syntax")
  17.   let main_syntax = 'jsp'
  18. endif
  19.  
  20. " Source HTML syntax
  21. if version < 600
  22.   source <sfile>:p:h/html.vim
  23. else
  24.   runtime! syntax/html.vim
  25. endif
  26. unlet b:current_syntax
  27.  
  28. " Next syntax items are case-sensitive
  29. syn case match
  30.  
  31. " Include Java syntax
  32. syn include @jspJava <sfile>:p:h/java.vim
  33.  
  34. syn region jspScriptlet matchgroup=jspTag start=/<%/  keepend end=/%>/ contains=@jspJava
  35. syn region jspComment                     start=/<%--/        end=/--%>/
  36. syn region jspDecl      matchgroup=jspTag start=/<%!/ keepend end=/%>/ contains=@jspJava
  37. syn region jspExpr      matchgroup=jspTag start=/<%=/ keepend end=/%>/ contains=@jspJava
  38. syn region jspDirective                   start=/<%@/         end=/%>/ contains=htmlString,jspDirName,jspDirArg
  39.  
  40. syn keyword jspDirName contained include page taglib
  41. syn keyword jspDirArg contained file uri prefix language extends import session buffer autoFlush
  42. syn keyword jspDirArg contained isThreadSafe info errorPage contentType isErrorPage
  43. syn region jspCommand                     start=/<jsp:/ start=/<\/jsp:/ keepend end=/>/ end=/\/>/ contains=htmlString,jspCommandName,jspCommandArg
  44. syn keyword jspCommandName contained include forward getProperty plugin setProperty useBean param params fallback
  45. syn keyword jspCommandArg contained id scope class type beanName page flush name value property
  46. syn keyword jspCommandArg contained code codebase name archive align height
  47. syn keyword jspCommandArg contained width hspace vspace jreversion nspluginurl iepluginurl
  48.  
  49. " Define the default highlighting.
  50. " For version 5.7 and earlier: only when not done already
  51. " For version 5.8 and later: only when an item doesn't have highlighting yet
  52. if version >= 508 || !exists("did_jsp_syn_inits")
  53.   if version < 508
  54.     let did_jsp_syn_inits = 1
  55.     command -nargs=+ HiLink hi link <args>
  56.   else
  57.     command -nargs=+ HiLink hi def link <args>
  58.   endif
  59.   " java.vim has redefined htmlComment highlighting
  60.   HiLink htmlComment     Comment
  61.   HiLink htmlCommentPart Comment
  62.   " Be consistent with html highlight settings
  63.   HiLink jspComment      htmlComment
  64.   HiLink jspTag          htmlTag
  65.   HiLink jspDirective    jspTag
  66.   HiLink jspDirName      htmlTagName
  67.   HiLink jspDirArg       htmlArg
  68.   HiLink jspCommand      jspTag
  69.   HiLink jspCommandName  htmlTagName
  70.   HiLink jspCommandArg   htmlArg
  71.   delcommand HiLink
  72. endif
  73.  
  74. if main_syntax == 'jsp'
  75.   unlet main_syntax
  76. endif
  77.  
  78. let b:current_syntax = "jsp"
  79.  
  80. " vim: ts=8
  81.